package com.red.star.macalline.sched.core.config;

import com.red.star.macalline.data.utils.SmsUtil;
import com.red.star.macalline.sched.service.StoredCardService;
import com.red.star.macalline.sched.task.CommonTask;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;

import javax.annotation.PostConstruct;

/**
 * @author AMGuo
 * @Description
 * @date 2018/03/14 16:22
 */
@Configuration
public class ProjectConfig {

    @Value("${wx.template.day}")
    private Integer days;

    @Value("${wx.template.day.page}")
    private String dayPage;

    @Value("${mass.send.template.id}")
    private String massSendTemplateId;

    @Value("${macalline.sms.url}")
    private String messageUrl;

    @PostConstruct
    public void postConstruct() {
        CommonTask.days = days;
        CommonTask.dayPage = dayPage;
        StoredCardService.MASS_SEND_TEMPLATE_ID = massSendTemplateId;
        SmsUtil.messageUrl = messageUrl;
    }

}
